home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c++,comp.lang.c
- Subject: Re: HELP!: Error when trying to use cout in MSVC++ 4.0!
- Date: 13 Mar 1996 07:40 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <13MAR199607405255@erich.triumf.ca>
- References: <4i5kpd$eic@mirv.unsw.edu.au>
- NNTP-Posting-Host: ftp.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <4i5kpd$eic@mirv.unsw.edu.au>, s2139589@cse.unsw.edu.au (CC) writes...
- >Hi,
- >
- >I am having trouble compiling a very simple program consisting of one
- >line of code in main(). I am using Microsoft Visual C++ Version 4.0 on
- >WIN95. Basically I am trying to use cout to print a word, however the
- >compiler keeps generating the following error:
- >
- >E:\Labs\lab1.c(4) : error C2065: 'cout' : undeclared identifier
- >E:\Labs\lab1.c(4) : error C2297: '<<' : bad right operand
- >Error executing cl.exe.
- >lab1.obj - 2 error(s), 0 warning(s)
-
- Quite likely your compiler thinks you are writing C, but cout only exists in
- C++.
-
- My Borland C++ will compile either C or C++, depending on the source file
- extension - if it's .c, then it is assumed to be C. If the extension is .cpp,
- it is assumed to be C++. MSVC may do the same.... (or there may be a switch
- somewhere to tell it to compile C++ regardless)
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
- or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
-
-
-
-
-
-
-